package com.taotao.job.core.localstore;

/**
 * 序列化器
 *
 * @author fanbeibei
 * @version 1.0
 * @date 2020/10/15 15:12
 */
public interface Serializer {


    /**
     * 序列化
     *
     * @param obj
     * @return
     */
    byte[] serialize(Object obj) throws Exception;

    /**
     * 反序列化
     *
     * @param bytes
     * @param clazz
     * @param <T>
     * @return
     */
    <T> T deserialize(byte[] bytes, Class<T> clazz) throws Exception;
}
